home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue70 / Clinic / COMSolution1 / ComClass1Impl.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-04-05  |  558 b   |  30 lines

  1. unit ComClass1Impl;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, ActiveX, Classes, ComObj, ComServer1_TLB, StdVcl,
  7.   BaseLib_TLB;
  8.  
  9. type
  10.   TComClass1 = class(TTypedComObject, IFoo)
  11.   protected
  12.     procedure Bar; safecall;
  13.     {Declare IComClass1 methods here}
  14.   end;
  15.  
  16. implementation
  17.  
  18. uses
  19.   ComServ, Dialogs;
  20.  
  21. procedure TComClass1.Bar;
  22. begin
  23.   ShowMessage('Hello from an instance of TComClass1 in ComServer1.dll')
  24. end;
  25.  
  26. initialization
  27.   TTypedComObjectFactory.Create(ComServer, TComClass1, Class_ComClass1,
  28.     ciMultiInstance, tmApartment);
  29. end.
  30.